namespace HexagonWeb.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class More20 : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Tickets",
                c => new
                    {
                        PNR = c.String(nullable: false, maxLength: 128),
                        Level = c.Int(nullable: false),
                        Row = c.Int(nullable: false),
                        Column = c.Int(nullable: false),
                        AirlineID = c.Int(nullable: false),
                        UserID = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.PNR)
                .ForeignKey("dbo.Airlines", t => t.AirlineID, cascadeDelete: true)
                .ForeignKey("dbo.Users", t => t.UserID, cascadeDelete: true)
                .Index(t => t.AirlineID)
                .Index(t => t.UserID);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Tickets", "UserID", "dbo.Users");
            DropForeignKey("dbo.Tickets", "AirlineID", "dbo.Airlines");
            DropIndex("dbo.Tickets", new[] { "UserID" });
            DropIndex("dbo.Tickets", new[] { "AirlineID" });
            DropTable("dbo.Tickets");
        }
    }
}
